Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging out of Gitlab and clearing session storage #793

Conversation

atomicgamedeveloper
Copy link
Contributor

Continuing off of commit ddab8e9 of pull request #681, this PR aims to fix issue #654 and #479. This commit fixes an invalid hook call in the MenuToolbar component by passing its AuthContextProps object to the signOut function. This keeps the hook call top-level as per the rules of hooks.

import { signOut } from 'util/auth/Authentication';
import { useAuth } from 'react-oidc-context';

jest.mock('react-oidc-context');
Copy link
Contributor

@prasadtalasila prasadtalasila Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prasadtalasila
Copy link
Contributor

@atomicgamedeveloper thanks for the update.

I see an error with the following command.

$yarn clean install
$yarn build
yarn run v1.22.22
warning ../../../../../package.json: No license field
$ npx react-scripts build
/home/dtaas/.npm/_npx/cd53aabf71f3f793/node_modules/resolve/lib/sync.js:113
    throw err;
    ^

Error: Cannot find module 'typescript' from '/home/dtaas/Documents/git/into-cps/DTaaS/client/node_modules'
    at Function.resolveSync [as sync] (/home/dtaas/.npm/_npx/cd53aabf71f3f793/node_modules/resolve/lib/sync.js:111:15)
    at getModules (/home/dtaas/.npm/_npx/cd53aabf71f3f793/node_modules/react-scripts/config/modules.js:119:32)
    at Object.<anonymous> (/home/dtaas/.npm/_npx/cd53aabf71f3f793/node_modules/react-scripts/config/modules.js:142:18)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/dtaas/.npm/_npx/cd53aabf71f3f793/node_modules/react-scripts/config/webpack.config.js:28:17) {
  code: 'MODULE_NOT_FOUND'
}

Node.js v20.12.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is an error due to outdated dependencies. We need to resolve this error before the code can be build. Do you know a fix? Thanks.

@prasadtalasila
Copy link
Contributor

My nodejs stack is

$yarn -v
1.22.22
$node -v
v20.12.2
$npm -v
10.5.0

@atomicgamedeveloper
Copy link
Contributor Author

Mine is:
yarn -v
1.22.22
node -v
v20.14.0
npm -v
10.7.0

I can try downgrading node and npm and remaking it from there.

@prasadtalasila
Copy link
Contributor

prasadtalasila commented Jun 23, 2024

@atomicgamedeveloper I am not able to replicate the logout functionality.

What I've tried:

yarn install
yarn build
yarn config:test
yarn start

Accessed the app at localhost:4000 and logged in using gitlab.com credentials. I've also tried with self-hosted gitlab solution. I am not able to logout in both cases.

PS: I am yet to test the server side logout

@prasadtalasila
Copy link
Contributor

@atomicgamedeveloper please also rebase your branch with the latest commit on feature/distributed-demo branch. Thanks.

@prasadtalasila
Copy link
Contributor

I've also checked with docker compose combination in compose.dev.yml and the logout does not happen there either. Please let me know if I'm doing something wrong. Thanks.

@atomicgamedeveloper
Copy link
Contributor Author

@prasadtalasila The PR is ready for review, thank you.

I have also looked into how long fetch could potentially run for in the current implementation: By default, Fetch API has no timeout set so the request may hang forever, but the AbortSignal.timeout() API provides an easy way to implement it.

@prasadtalasila
Copy link
Contributor

@atomicgamedeveloper please use AbortSignal with a timeout of 30 seconds.

@prasadtalasila
Copy link
Contributor

prasadtalasila commented Jul 4, 2024

@atomicgamedeveloper please rebase to the latest commit on feature/distributed-demo branch. Thanks.

Copy link

codeclimate bot commented Jul 5, 2024

Code Climate has analyzed commit 5402b78 and detected 0 issues on this pull request.

View more on Code Climate.

@prasadtalasila prasadtalasila merged commit d83f95a into INTO-CPS-Association:feature/distributed-demo Jul 5, 2024
3 checks passed
This was referenced Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants